public class HomeWork11_01{
    public static void main(String[] args){
        int[] arr = new int[]{1, 2, 3, 4, 5, 6};
        int[] cent = IntArrCent.intArrCent(arr);   
        for(int item : cent){
            System.out.println(item);
        }
    }
}

class IntArrCent{
    public static int[] intArrCent(int[] arr){
        if(arr.length % 2 != 0){
            return new int[]{arr[arr.length/2]};
        }else{
            return new int[]{arr[arr.length/2 - 1], arr[arr.length/2]};
        }
    }
}